<template>
	<div>
		<span>{{Title}}</span>
		<span>{{Categories}}</span>
		<span>{{EditorContent}}</span>
		<span>{{Time | formatDate}}</span>
		<span><div  @click="delect()">删除</div></span>
	</div>
</template>

<script>
import axios from 'axios'
import formatDate from '~/static/filter/date.js'
export default {
	props:['Title','Categories','EditorContent','Time','ListId'],
	methods:{
		delect(){
			console.log(this.ListId)
			axios.post('/admin/del',{
				ArticleId:this.ListId
			}).then(response=>{
				if(response.data.code==200 && response.data.message){
					console.log("删除成功")
					this.$router.push({name:'admin-fabwz'})
				}
			})
		}
	},
	created(){
		console.log(this.ListId)
	},
	filters: {
        formatDate(time) {
            var date = new Date(time);
            return formatDate(date, "yyyy-MM-dd hh:mm:ss");
        }
      },
}
</script>

<style lang="stylus" scoped>
p
	border-bottom 1px solid #ccc
	padding 10px
.title
	line-height 40px
	span 
		float left
		width 20%
		text-align center
		border-right 1px solid #ccc
		border-bottom 1px solid #ccc
		overflow hidden
		height 41px
		div
			color #222
			text-decoration none
			padding 10px
			margin-left 5px
			background-color skyblue
			display inline
			cursor pointer
		div:nth-child(2)
			background-color red
	span:nth-child(1)
		border-left 1px solid #ccc
</style>

